home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / setup.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  3.1 KB  |  105 lines

  1. c spice version 2g.6  sccsid=setup.ma 3/15/83
  2.       subroutine setup
  3.       implicit double precision (a-h,o-z)
  4. c
  5. c     this routine drives the sparse matrix setup used by spice.
  6. c
  7. c spice version 2g.6  sccsid=tabinf 3/15/83
  8.       common /tabinf/ ielmnt,isbckt,nsbckt,iunsat,nunsat,itemps,numtem,
  9.      1   isens,nsens,ifour,nfour,ifield,icode,idelim,icolum,insize,
  10.      2   junode,lsbkpt,numbkp,iorder,jmnode,iur,iuc,ilc,ilr,numoff,isr,
  11.      3   nmoffc,iseq,iseq1,neqn,nodevs,ndiag,iswap,iequa,macins,lvnim1,
  12.      4   lx0,lvn,lynl,lyu,lyl,lx1,lx2,lx3,lx4,lx5,lx6,lx7,ld0,ld1,ltd,
  13.      5   imynl,imvn,lcvn,nsnod,nsmat,nsval,icnod,icmat,icval,
  14.      6   loutpt,lpol,lzer,irswpf,irswpr,icswpf,icswpr,irpt,jcpt,
  15.      7   irowno,jcolno,nttbr,nttar,lvntmp
  16. c spice version 2g.6  sccsid=cirdat 3/15/83
  17.       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop,
  18.      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc
  19. c spice version 2g.6  sccsid=miscel 3/15/83
  20.       common /miscel/ atime,aprog(3),adate,atitle(10),defl,defw,defad,
  21.      1  defas,rstats(50),iwidth,lwidth,nopage
  22. c spice version 2g.6  sccsid=flags 3/15/83
  23.       common /flags/ iprnta,iprntl,iprntm,iprntn,iprnto,limtim,limpts,
  24.      1   lvlcod,lvltim,itl1,itl2,itl3,itl4,itl5,itl6,igoof,nogo,keof
  25. c spice version 2g.6  sccsid=dc 3/15/83
  26.       common /dc/ tcstar(2),tcstop(2),tcincr(2),icvflg,itcelm(2),kssop,
  27.      1   kinel,kidin,kovar,kidout
  28. c spice version 2g.6  sccsid=ac 3/15/83
  29.       common /ac/ fstart,fstop,fincr,skw2,refprl,spw2,jacflg,idfreq,
  30.      1   inoise,nosprt,nosout,nosin,idist,idprt
  31. c spice version 2g.6  sccsid=blank 3/15/83
  32.       common /blank/ value(200000)
  33.       integer nodplc(64)
  34.       complex cvalue(32)
  35.       equivalence (value(1),nodplc(1),cvalue(1))
  36. c
  37.       logical memptr
  38. c
  39.       call second(t1)
  40.       nstop=numnod+jelcnt(3)+jelcnt(6)+jelcnt(8)+jelcnt(9)+2*jelcnt(17)
  41. c
  42. c     clear old tables
  43. c
  44.       if (memptr(irpt)) call clrmem(irpt)
  45.       if (memptr(jcpt)) call clrmem(jcpt)
  46.       if (memptr(irowno)) call clrmem(irowno)
  47.       if (memptr(jcolno)) call clrmem(jcolno)
  48. c
  49. c  reserve matrix locations for each element
  50. c
  51.       call matptr
  52.       if (nogo.ne.0) go to 1000
  53. c
  54. c  reorder matrix pointers
  55. c
  56.       nttbr=0
  57.       do 120 i=2,nstop
  58.       loc=i
  59.   110 if (nodplc(jcpt+loc).eq.0) go to 120
  60.       loc=nodplc(jcpt+loc)
  61.       nttbr=nttbr+1
  62.       go to 110
  63.   120 continue
  64. c...  add ground
  65.       nttar=nttbr
  66.       call reordr
  67.       if (nogo.ne.0) go to 1000
  68. c
  69. c  store matrix locations
  70. c
  71.       call matloc
  72. c
  73. c  .nodeset
  74. c
  75.   200 call sizmem(nsnod,nic)
  76.       if(nic.eq.0) go to 220
  77.       call getm4(nsmat,nic)
  78.       do 210 i=1,nic
  79.       node=nodplc(nsnod+i)
  80.       nodplc(nsmat+i)=indxx(node,node)
  81.   210 continue
  82. c
  83. c  transient initial conditions
  84. c
  85.   220 call sizmem(icnod,nic)
  86.       if(nic.eq.0) go to 300
  87.       call getm4(icmat,nic)
  88.       do 230 i=1,nic
  89.       node=nodplc(icnod+i)
  90.       nodplc(icmat+i)=indxx(node,node)
  91.   230 continue
  92. c
  93.   300 call clrmem(iseq)
  94.       call clrmem(iseq1)
  95.       call clrmem(neqn)
  96.       call clrmem(nodevs)
  97.       call clrmem(ndiag)
  98. c
  99. c  finished
  100. c
  101.  1000 call second(t2)
  102.       rstats(2)=rstats(2)+t2-t1
  103.       return
  104.       end
  105.